<html>
<head><meta charset="utf-8"><title>assoc types in inherent impls · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/assoc.20types.20in.20inherent.20impls.html">assoc types in inherent impls</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="163566077"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/assoc%20types%20in%20inherent%20impls/near/163566077" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/assoc.20types.20in.20inherent.20impls.html#163566077">(Apr 17 2019 at 14:33)</a>:</h4>
<p>Is there a timeline on supporting:</p>
<div class="codehilite"><pre><span></span><span class="k">struct</span> <span class="nc">A</span><span class="p">;</span><span class="w"></span>
<span class="k">struct</span> <span class="nc">B</span><span class="p">;</span><span class="w"></span>
<span class="k">impl</span><span class="w"> </span><span class="n">A</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="k">type</span> <span class="nc">C</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">B</span><span class="p">;</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
</pre></div>


<p>?</p>



<a name="163566160"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/assoc%20types%20in%20inherent%20impls/near/163566160" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/assoc.20types.20in.20inherent.20impls.html#163566160">(Apr 17 2019 at 14:34)</a>:</h4>
<p>that's lazy normalization</p>



<a name="163566176"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/assoc%20types%20in%20inherent%20impls/near/163566176" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/assoc.20types.20in.20inherent.20impls.html#163566176">(Apr 17 2019 at 14:34)</a>:</h4>
<p>yes, the same thing as [u8; size_of::&lt;T&gt;()]</p>



<a name="163566191"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/assoc%20types%20in%20inherent%20impls/near/163566191" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/assoc.20types.20in.20inherent.20impls.html#163566191">(Apr 17 2019 at 14:34)</a>:</h4>
<p>even for that case without generics ?</p>



<a name="163566214"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/assoc%20types%20in%20inherent%20impls/near/163566214" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/assoc.20types.20in.20inherent.20impls.html#163566214">(Apr 17 2019 at 14:35)</a>:</h4>
<p>hmm</p>



<a name="163566242"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/assoc%20types%20in%20inherent%20impls/near/163566242" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/assoc.20types.20in.20inherent.20impls.html#163566242">(Apr 17 2019 at 14:35)</a>:</h4>
<p>we could add eagerly normalizing &lt;T&gt;::X types</p>



<a name="163566257"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/assoc%20types%20in%20inherent%20impls/near/163566257" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/assoc.20types.20in.20inherent.20impls.html#163566257">(Apr 17 2019 at 14:35)</a>:</h4>
<p>so maybe sooner than lazy normalization</p>



<a name="163566266"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/assoc%20types%20in%20inherent%20impls/near/163566266" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/assoc.20types.20in.20inherent.20impls.html#163566266">(Apr 17 2019 at 14:36)</a>:</h4>
<p>cc <span class="user-mention" data-user-id="116009">@nikomatsakis</span></p>



<a name="163566342"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/assoc%20types%20in%20inherent%20impls/near/163566342" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/assoc.20types.20in.20inherent.20impls.html#163566342">(Apr 17 2019 at 14:36)</a>:</h4>
<p><span class="user-mention" data-user-id="132920">@gnzlbg</span> but if we do this we would have two systems for the T::X syntax</p>



<a name="163566344"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/assoc%20types%20in%20inherent%20impls/near/163566344" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/assoc.20types.20in.20inherent.20impls.html#163566344">(Apr 17 2019 at 14:36)</a>:</h4>
<p>i mean, the issue has been open for like 6-7 years, and the last update is that it is blocked on chalk, but I really don't see what problem would chalk need to solve there</p>



<a name="163566355"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/assoc%20types%20in%20inherent%20impls/near/163566355" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/assoc.20types.20in.20inherent.20impls.html#163566355">(Apr 17 2019 at 14:36)</a>:</h4>
<p>hehe</p>



<a name="163566359"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/assoc%20types%20in%20inherent%20impls/near/163566359" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/assoc.20types.20in.20inherent.20impls.html#163566359">(Apr 17 2019 at 14:36)</a>:</h4>
<p>the RFC was accepted like 7 years ago</p>



<a name="163566375"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/assoc%20types%20in%20inherent%20impls/near/163566375" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/assoc.20types.20in.20inherent.20impls.html#163566375">(Apr 17 2019 at 14:37)</a>:</h4>
<p>so that is just awaiting implementation</p>



<a name="163566381"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/assoc%20types%20in%20inherent%20impls/near/163566381" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/assoc.20types.20in.20inherent.20impls.html#163566381">(Apr 17 2019 at 14:37)</a>:</h4>
<p>blocked on chalk is code for lazy normalization</p>



<a name="163566388"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/assoc%20types%20in%20inherent%20impls/near/163566388" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/assoc.20types.20in.20inherent.20impls.html#163566388">(Apr 17 2019 at 14:37)</a>:</h4>
<p>sometimes</p>



<a name="163566430"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/assoc%20types%20in%20inherent%20impls/near/163566430" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/assoc.20types.20in.20inherent.20impls.html#163566430">(Apr 17 2019 at 14:38)</a>:</h4>
<p>I can imagine that this is true when generics are involved</p>



<a name="163566478"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/assoc%20types%20in%20inherent%20impls/near/163566478" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/assoc.20types.20in.20inherent.20impls.html#163566478">(Apr 17 2019 at 14:38)</a>:</h4>
<p>we can try to do something sooner, there's just a risk it'd be backwards incompat with the real thing</p>



<a name="163566525"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/assoc%20types%20in%20inherent%20impls/near/163566525" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/assoc.20types.20in.20inherent.20impls.html#163566525">(Apr 17 2019 at 14:38)</a>:</h4>
<p>how far is lazy normalization ?</p>



<a name="163566758"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/assoc%20types%20in%20inherent%20impls/near/163566758" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/assoc.20types.20in.20inherent.20impls.html#163566758">(Apr 17 2019 at 14:41)</a>:</h4>
<p>There's new movement on it since today: <a href="#narrow/stream/144729-wg-traits/topic/lazy.20normalization" title="#narrow/stream/144729-wg-traits/topic/lazy.20normalization">https://rust-lang.zulipchat.com/#narrow/stream/144729-wg-traits/topic/lazy.20normalization</a></p>



<a name="163567079"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/assoc%20types%20in%20inherent%20impls/near/163567079" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/assoc.20types.20in.20inherent.20impls.html#163567079">(Apr 17 2019 at 14:44)</a>:</h4>
<blockquote>
<p>there's just a risk it'd be backwards incompat with the real thing</p>
</blockquote>
<p><span class="user-mention" data-user-id="119009">@eddyb</span> hmm, why?</p>



<a name="163567086"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/assoc%20types%20in%20inherent%20impls/near/163567086" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/assoc.20types.20in.20inherent.20impls.html#163567086">(Apr 17 2019 at 14:44)</a>:</h4>
<p>and if so, let's please not rush this and do it properly</p>



<a name="163567118"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/assoc%20types%20in%20inherent%20impls/near/163567118" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/assoc.20types.20in.20inherent.20impls.html#163567118">(Apr 17 2019 at 14:45)</a>:</h4>
<p>I would really like to avoid the same fuckup that type aliases have</p>



<a name="163576392"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/assoc%20types%20in%20inherent%20impls/near/163576392" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/assoc.20types.20in.20inherent.20impls.html#163576392">(Apr 17 2019 at 16:18)</a>:</h4>
<p><span class="user-mention" data-user-id="126931">@centril</span> things like fallback (inherent -&gt; bounds -&gt; trait impls, etc.)</p>



<a name="163576466"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/assoc%20types%20in%20inherent%20impls/near/163576466" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/assoc.20types.20in.20inherent.20impls.html#163576466">(Apr 17 2019 at 16:19)</a>:</h4>
<p>ah</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>